package cn.lx.expansion.dynamic2;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * @author lixin
 * @Classname DynamicProxy
 * @Description TODO
 * @Date 2019/10/5 下午4:08
 */
public class DynamicProxy<T> {

    public static <T> T newProxyInstance(ClassLoader classLoader, Class<?>[] interfaces, InvocationHandler h) {
        // 寻找连接点
        if (true) {
            (new BeforeAdvice()).exec();
        }
        return (T) Proxy.newProxyInstance(classLoader, interfaces, h);
    }
}
